﻿
namespace SampleCode.VirtualFS
{
    /// <summary>
    /// A public folder, to be returned in a collection
    /// </summary>
    public class FsFolderInfo
    {
        /// <summary>
        /// Internal ctor
        /// </summary>
        /// <param name="name">Folder name</param>
        /// <param name="fullName">Folder path</param>
        internal FsFolderInfo(string name, string fullName)
        {
            Name        = name;
            FullName    = fullName;
        }

        /// <summary>
        /// A ctor used for events
        /// </summary>
        /// <param name="fullName"></param>
        internal FsFolderInfo(string fullName)
        {
            FullName = fullName;
            int pos = FullName.LastIndexOf(FsDisk.ExternalPathSeparator);
            Name = pos < 0 ? FullName : FullName.Substring(pos + 1);
        }

        // Public properties
        public string Name { get; private set; }
        public string FullName { get; private set; }
    }
}
